<?xml version="1.0" encoding="UTF-8"?>
<as:AppSchemaDataAccess xmlns:as="http://www.geotools.org/app-schema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.geotools.org/app-schema AppSchemaDataAccess.xsd">
    <namespaces>
        <Namespace>
            <prefix>gml</prefix>
            <uri>http://www.opengis.net/gml</uri>
        </Namespace>
        <Namespace>
            <prefix>gsml</prefix>
            <uri>urn:cgi:xmlns:CGI:GeoSciML:2.0</uri>
        </Namespace>
        <Namespace>
            <prefix>xlink</prefix>
            <uri>http://www.w3.org/1999/xlink</uri>
        </Namespace>
    </namespaces>
    <sourceDataStores>
        <DataStore>
            <id>CGI_PlanarOrientation</id>
            <parameters>
                <Parameter>
                    <name>directory</name>
                    <value>file:./</value>
                </Parameter>
            </parameters>
        </DataStore>
    </sourceDataStores>
    <targetTypes>
        <FeatureType>
            <schemaUri>http://www.geosciml.org/geosciml/2.0/xsd/geosciml.xsd</schemaUri>
        </FeatureType>
    </targetTypes>
    <typeMappings>
        <FeatureTypeMapping>
            <sourceDataStore>CGI_PlanarOrientation</sourceDataStore>
            <sourceType>CGI_PlanarOrientation</sourceType>
            <targetElement>gsml:CGI_PlanarOrientation</targetElement>
            <attributeMappings>
                <AttributeMapping>
                    <targetAttribute>gsml:CGI_PlanarOrientation</targetAttribute>                    
					<idExpression>
                        <OCQL>ID</OCQL>
                    </idExpression>
                </AttributeMapping>
                <AttributeMapping>
                    <targetAttribute>FEATURE_LINK</targetAttribute>
                    <sourceExpression>
                        <OCQL>ID</OCQL>
                    </sourceExpression>
                </AttributeMapping>
                <AttributeMapping>
                    <targetAttribute>gsml:convention</targetAttribute>
                    <sourceExpression>
                        <OCQL>CONVENTION</OCQL>
                    </sourceExpression>
                </AttributeMapping>
                <AttributeMapping>
                    <targetAttribute>
						gsml:azimuth
  		            </targetAttribute>
                    <sourceExpression>
                        <linkElement>if_then_else(isNull(AZIMUTH_NUMERIC), '_er_mo_planarOrientation_azimuth_literal', '_er_mo_planarOrientation_azimuth_numeric')</linkElement>
                    </sourceExpression>
                </AttributeMapping>
                <AttributeMapping>
                    <targetAttribute>
						gsml:dip
  		            </targetAttribute>
                    <sourceExpression>
                        <linkElement>if_then_else(isNull(DIP_NUMERIC), '_er_mo_planarOrientation_dip_literal', '_er_mo_planarOrientation_dip_numeric')</linkElement>
                    </sourceExpression>
                </AttributeMapping>
                <AttributeMapping>
                    <targetAttribute>gsml:polarity</targetAttribute>
                    <sourceExpression>
                        <OCQL>'not applicable'</OCQL>
                    </sourceExpression>
                </AttributeMapping>
            </attributeMappings>
        </FeatureTypeMapping>
        <FeatureTypeMapping>
            <mappingName>_er_mo_planarOrientation_azimuth_numeric</mappingName>
            <sourceDataStore>CGI_PlanarOrientation</sourceDataStore>
            <sourceType>CGI_PlanarOrientation</sourceType>
            <targetElement>gsml:CGI_NumericValue</targetElement>
            <attributeMappings>
                <AttributeMapping>
                    <targetAttribute>gsml:principalValue</targetAttribute>
                    <sourceExpression>
                        <OCQL>AZIMUTH_NUMERIC</OCQL>
                    </sourceExpression>
                    <ClientProperty>
                        <name>uom</name>
                        <value>'urn:ogc:def:uom:UCUM::deg'</value>
                    </ClientProperty>
                </AttributeMapping>
            </attributeMappings>
        </FeatureTypeMapping>
        <FeatureTypeMapping>
            <mappingName>_er_mo_planarOrientation_azimuth_literal</mappingName>
            <sourceDataStore>CGI_PlanarOrientation</sourceDataStore>
            <sourceType>CGI_PlanarOrientation</sourceType>
            <targetElement>gsml:CGI_TermValue</targetElement>
            <attributeMappings>
                <AttributeMapping>
                    <targetAttribute>gsml:value</targetAttribute>
                    <sourceExpression>
                        <OCQL>AZIMUTH_STRING</OCQL>
                    </sourceExpression>
                    <ClientProperty>
                        <name>codeSpace</name>
                        <value>'http://www.dmp.wa.gov.au/371.aspx'</value>
                    </ClientProperty>
                </AttributeMapping>
            </attributeMappings>
        </FeatureTypeMapping>
        <FeatureTypeMapping>
            <mappingName>_er_mo_planarOrientation_dip_numeric</mappingName>
            <sourceDataStore>CGI_PlanarOrientation</sourceDataStore>
            <sourceType>CGI_PlanarOrientation</sourceType>
            <targetElement>gsml:CGI_NumericValue</targetElement>
            <attributeMappings>
                <AttributeMapping>
                    <targetAttribute>gsml:principalValue</targetAttribute>
                    <sourceExpression>
                        <OCQL>DIP_NUMERIC</OCQL>
                    </sourceExpression>
                    <ClientProperty>
                        <name>uom</name>
                        <value>'urn:ogc:def:uom:UCUM::deg'</value>
                    </ClientProperty>
                </AttributeMapping>
            </attributeMappings>
        </FeatureTypeMapping>
        <FeatureTypeMapping>
            <mappingName>_er_mo_planarOrientation_dip_literal</mappingName>
            <sourceDataStore>CGI_PlanarOrientation</sourceDataStore>
            <sourceType>CGI_PlanarOrientation</sourceType>
            <targetElement>gsml:CGI_TermValue</targetElement>
            <attributeMappings>
                <AttributeMapping>
                    <targetAttribute>gsml:value</targetAttribute>
                    <sourceExpression>
                        <OCQL>DIP_STRING</OCQL>
                    </sourceExpression>
                    <ClientProperty>
                        <name>codeSpace</name>
                        <value>'http://www.dmp.wa.gov.au/371.aspx'</value>
                    </ClientProperty>
                </AttributeMapping>
            </attributeMappings>
        </FeatureTypeMapping>
    </typeMappings>
</as:AppSchemaDataAccess>
		